﻿Public Class XFormCalificarParticipantes

    Private Sub XFormCalificarParticipantes_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Cargar()
    End Sub

    Sub Cargar()
        CarrerasTableAdapter.Fill(DsEvento.Carreras)
        ParticipantesMujeresTableAdapter.Fill(DsEvento.ParticipantesMujeres, EventoActivo.IDEvento)
        ParticipantesHombresTableAdapter.Fill(DsEvento.ParticipantesHombres, EventoActivo.IDEvento)
    End Sub

    Private Structure IDS
        Dim IDH As Integer
        Dim IDM As Integer
    End Structure

    Private Function DameID() As IDS
        Try
            Dim ids As IDS
            ids.IDM = GridView1.GetRowCellValue(GridView1.FocusedRowHandle, "IDParticipante")
            ids.IDH = GridView2.GetRowCellValue(GridView2.FocusedRowHandle, "IDParticipante")
            Return ids
        Catch ex As Exception
            Return Nothing
        End Try
    End Function

    Private Sub GridControl1_DoubleClick(sender As System.Object, e As System.EventArgs) Handles GridControl1.DoubleClick
        Dim ID As Integer = DameID.IDM
        With XFormCalificarParticipante
            .IDParticipante1 = ID
            .MdiParent = Me.MdiParent
            .Show()
            .Focus()
        End With
    End Sub

    Private Sub GridControl2_DoubleClick(sender As System.Object, e As System.EventArgs) Handles GridControl2.DoubleClick
        Dim ID As Integer = DameID.IDH
        With XFormCalificarParticipante
            .IDParticipante1 = ID
            .MdiParent = Me.MdiParent
            .Show()
            .Focus()
        End With
    End Sub
End Class